//
// Created by hkkzzxz on 24-9-4.
//

#include "TokenError.h"

void TokenError::tokenError(std::string &id, http::request<http::dynamic_body> &httpRequest,
                            http::response<http::dynamic_body> &httpResponse) {
    Json::Value root;
    root["code"] = 401;
    root["data"] = id;
    root["message"] = "Unauthorized: Token is invalid or expired!";
    httpResponse.result(http::status::unauthorized);
    setHttpResponse(httpResponse, root);
}
